home *** CD-ROM | disk | FTP | other *** search
- Path: cnn.Princeton.EDU!franck!tim
- From: tim@franck (Tim Hollebeek)
- Newsgroups: comp.std.c
- Subject: Initializing a variable in terms of itself
- Date: 1 Apr 1996 21:53:57 GMT
- Organization: Princeton University
- Message-ID: <4jpj9l$ik9@cnn.Princeton.EDU>
- Reply-To: tim@wfn-shop.princeton.edu
- NNTP-Posting-Host: franck.princeton.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Just out of curiosity, is this legal?
-
- int main() {
- int x = x;
- return 0;
- }
-
- gcc compiles it without even a warning, suprisingly. I had a slightly
- more complex version of the same thing which was part of a bug in
- another program, and would like to have known about it (the second x
- was a typo).
-
- ---------------------------------------------------------------------------
- Tim Hollebeek | Disclaimer :=> Everything above is a true statement,
- Electron Psychologist | for sufficiently false values of true.
- Princeton University | email: tim@wfn-shop.princeton.edu
- ----------------------| http://wfn-shop.princeton.edu/~tim (NEW! IMPROVED!)
-